//
//  UINavigationItem+Extend.m
//  ReviewDemo
//
//  Created by 龙 on 2018/3/16.
//  Copyright © 2018年 long. All rights reserved.
//

#import "UINavigationItem+Extend.h"
#import "NSObject+Swizzling.h"
#import <objc/runtime.h>

static char *kCustomBackButtonKey;

@implementation UINavigationItem (Extend)

//+ (void)load {
//    static dispatch_once_t onceToken;
//    dispatch_once(&onceToken, ^{
////        [self methodSwizzlingWithOriginalSelector:@selector(backBarButtonItem)
////                               bySwizzledSelector:@selector(sure_backBarButtonItem)];
//        
//    });
//}


//- (UIBarButtonItem*)sure_backBarButtonItem {
//    UIBarButtonItem *backItem = [self sure_backBarButtonItem];
//    if (backItem) {
//        return backItem;
//    }
//    backItem = objc_getAssociatedObject(self, &kCustomBackButtonKey);
//    if (!backItem) {
//        backItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"navigationItemBack"] style:UIBarButtonItemStylePlain target:nil action:NULL];
//        objc_setAssociatedObject(self, &kCustomBackButtonKey, backItem, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
//    }
//    return backItem;
//}

@end
